<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/users.js"></script>
</head>

<style>
    .mydiv{
        margin:0 auto;
        width:300px;
        height:200px;
    }

</style>

<body class="mydiv">

<form action="${users==null?'users/save.action':'users/update.action' }" method="post" onsubmit="return toSubmit()">
    <input type="hidden" name="id" value="${users.id}">
    <table border="1">
        <tr>
            <td>用户名</td>
            <td>
                <input type="text" name="username" value="${users.username}" onblur="checkUsername(this.value)">
                <span id="error"></span>
            </td>
        </tr>
        <tr>
            <td>年龄</td>
            <td>
                <input type="text" name="age" value="${users.age}">
            </td>
        </tr>
        <tr>
            <td>性别</td>
            <td>
                <input type="radio" name="sex" value="男">男
                <input type="radio" name="sex" value="女">女<br>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center;">
                <input type="submit" value="注册"/>
                <input type="reset" value="重置"/>
                <span id="errors"></span>
            </td>
        </tr>
    </table>


</form>

</body>
</html>
